package com.woniu.user.client;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.woniu.result.Result;
import com.woniu.user.client.result.AddressResultInfo;
import com.woniu.user.client.result.CityResultInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


@FeignClient(contextId = "addressQueryClient", name = "user")
public interface AddressQueryClient {
    //查询全部地址
    @GetMapping("getAddType")
    public Result<List<CityResultInfo>> getAddType() throws JsonProcessingException;

    //查询用户所有地址
    @GetMapping("getUserAddress")
    public Result<List<AddressResultInfo>> getUserAddress(@RequestParam("userId") Integer userId, @RequestParam("addressId") Integer addressId);

    /**
     * 地址Id查询地址
     *
     * @param addressId
     * @return
     */
    @GetMapping("/getUserAddressById")
    Result<AddressResultInfo> getUserAddressById(@RequestParam("addressId") Integer addressId);
}

